package com.xj.opcua.client;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Predicate;

import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
import org.eclipse.milo.opcua.sdk.client.api.identity.AnonymousProvider;
import org.eclipse.milo.opcua.sdk.client.api.identity.IdentityProvider;
import org.eclipse.milo.opcua.stack.core.security.SecurityPolicy;
import org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription;

import com.alibaba.fastjson.JSONObject;


public class Client {
	
	/*
	 * 订阅返回值列表 
	 */
	public static Map<String,JSONObject> subValues= new LinkedHashMap<String, JSONObject>();
	
	/*
	 * 连接的客户端列表
	 */
	public static Map<String, List<Object>> map = new HashMap<String, List<Object>>();
	
	private String url;
	
	public Client() {
	}
	
	public Client(String url) {
		this.url = url;
	}
	
    public String getEndpointUrl() {
        return url;
    }
    
    public Predicate<EndpointDescription> endpointFilter() {
        return e -> true;
    }

    public SecurityPolicy getSecurityPolicy() {
        return SecurityPolicy.None;
    }

    public IdentityProvider getIdentityProvider() {
        return new AnonymousProvider();
    }

    public void run(OpcUaClient client, CompletableFuture<OpcUaClient> future,String url) throws Exception{};
    
}
